package cn.gson.crm.controller.pay;

import java.util.List;
import java.util.Map;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSONArray;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.EmploDao;

@WebServlet("/search_pay_record/ajax")
public class SearchPayRecordAjax extends BaseServlet{
	private EmploDao empDao = new EmploDao();
	/**
	 * 查询缴费记录界面初步ajax判断
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String empName = request.getParameter("empName");
		
		if(empName!=null&&!empName.trim().isEmpty()){
			List<String> nameList = empDao.getNameList(empName);
			StringBuffer buffer = new StringBuffer();
			
			for (String string : nameList) {
				String jsonStr = JSONArray.toJSONString(string);
				System.out.println(jsonStr);
				// 输出结果
				response.getWriter().append(jsonStr);
			}
			
		}
	}
}
